package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.EXAM01.TASK1;

public class HalfCircle_Controllers implements IGeometricObject{

	private HalfCircle_Entity Obj;
	
	public HalfCircle_Controllers(HalfCircle_Entity obj) {
		Obj = obj;
	}
	
	@Override
	public double getArea(Object obj) {
		HalfCircle_Entity Obj = (HalfCircle_Entity) obj;
		return Math.PI* Math.pow(Obj.getRadius(), 2)/2;
	}

	@Override
	public double getPerimeter(Object obj) {
		HalfCircle_Entity Obj = (HalfCircle_Entity) obj;
		return 2*Math.PI*Obj.getRadius();
	}
}
